package com.ss.android.download;

import android.os.AsyncTask;

import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;

final class f extends AsyncTask {
    private final e d;
    private final com.ss.android.download.e.e$c a;
    private final String b;
    private final long c;

    f(com.ss.android.download.e arg1, com.ss.android.download.e.e$c arg2, String arg3, long arg4) {
        this.d = arg1;
        this.a = arg2;
        this.b = arg3;
        this.c = arg4;
    }

    private Void a() {
        try {
            URLConnection v0_1 = new URL(com.ss.android.download.e.e$c.a(this.a).toString()).openConnection();
            ((HttpURLConnection) v0_1).setInstanceFollowRedirects(false);
            ((HttpURLConnection) v0_1).setConnectTimeout(20000);
            ((HttpURLConnection) v0_1).setReadTimeout(20000);
            ((HttpURLConnection) v0_1).addRequestProperty("User-Agent", com.ss.android.download.aa.b);
            ((HttpURLConnection) v0_1).setRequestProperty("Accept-Encoding", "identity");
            ((HttpURLConnection) v0_1).addRequestProperty("If-None-Match", this.b);
            if (((HttpURLConnection) v0_1).getResponseCode() == 304) {
                this.d.a(this.c);
                return null;
            }

            this.d.a(com.ss.android.download.e.e$c.b(this.a), new long[]{this.c});
        } catch (Exception v0) {
            v0.printStackTrace();
        }

        return null;
    }

    protected final Object doInBackground(Object[] arg2) {
        return this.a();
    }
}

